package org.microsites.remote.dwr;

import java.util.ArrayList;
import java.util.List;

import org.microsites.domain.model.Group;
import org.microsites.remote.GroupRemote;
import org.microsites.service.GroupService;
import org.microsites.service.HostService;

public class GroupRemoteImpl extends GenericRemoteImpl<Group> implements GroupRemote {

	private GroupService groupService;
	private HostService hostService;
	
	public List<Object> listContent(Long id) {
		List<Object> list = new ArrayList<Object>();
		
		list.addAll(groupService.sublist(id));
		list.addAll(hostService.sublist(id));
		
		return list;
	}

	@Override
	public Group getRoot(String name) {
		return getService().getRoot(name);
	}

	public GroupService getService() {
		return groupService;
	}

	public void setGroupService(GroupService groupService) {
		this.groupService = groupService;
	}

	public HostService getHostService() {
		return hostService;
	}

	public void setHostService(HostService hostService) {
		this.hostService = hostService;
	}

}
